import { createApp } from 'vue'
import App from './App.vue'

// 导入mock
// import '../mock'

// element-plus样式
import 'element-plus/dist/index.css'

// 导入全局svg
import "@/plugins/svgIcon"

// 全局样式
import './styles/index.css'

// 图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 国际化
import { setUpI18n } from "@/locales"

// 状态
import { setupStore } from './store'

// 路由
import { setupRouter } from './router'

import "./permission"
import { permissionDirective } from './utils/directive'
const setupAll = () => {
  const app = createApp(App)

  app.directive('per', permissionDirective);

  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
  setUpI18n(app)
  setupStore(app)
  setupRouter(app)
  app.mount('#app')
}

setupAll()